package com.josework.springhelloworld.entity.Serialize;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;

public class DeserialTest {

    //反序列化
    public static void main(String[] args) {
        Persion p;
        try {
            FileInputStream fis = new FileInputStream("Persion.txt");
            ObjectInputStream ois = new ObjectInputStream(fis);
            p = (Persion) ois.readObject();
            ois.close();
            System.out.println(p.toString());
            System.out.println(p.userName);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
